<template>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column prop="value" label="value" width="180" />
    <el-table-column prop="link" label="link" />
    <el-table-column prop="address" label="Address" />
    <el-table-column label="Operations">
      <template #default="scope">
        <el-button size="small" @click="handleEdit(scope.$index, scope.row)">Edit</el-button>
        <el-button size="small" type="danger" @click="handleDelete(scope.$index, scope.row)"
          >Delete</el-button
        >
      </template>
    </el-table-column>
  </el-table>
</template>

<script setup>
import { storeToRefs } from 'pinia'
import { useTestStore } from './test'
const testStore = useTestStore()
const { tableData } = storeToRefs(testStore)
const handleEdit = (index, row) => {
  testStore.preInfo4Mod(index, row)
  console.log(index, row)
}
const handleDelete = (index, row) => {
  console.log(index, row)
}
</script>
